package day03;

public class IfDemo{
    public static void main(String[] args) {
//        int price = (int)(Math.random()*2000);
        int price = 400;
        System.out.println("今日消费原价为："+price+"元。");
        if(price>=500 && price<700){
            price *= 0.8;
            System.out.println("为您打8折");
        }else if(price>=700 && price<1200){//--------------有的可以省略，省略的条件等于上一个条件的非
            price *= 0.7;
            System.out.println("为您打7折");
        }else if(price>=1200){
            price *= 0.6;
            System.out.println("为您打6折");
        }else{

        }
        System.out.println("今日消费为："+price+"元。");
    }
}
